package com.atguigu.config;

import com.atguigu.service.HelloService;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

// Spring配置文件类
@Configuration
public class MyAppConfig {

    // 跟<bean></bean>功能一样
    // 组件id就是方法名，返回值添加到容器中
    @Bean
    public HelloService helloService() {
        System.out.println("配置类@Bean给容器中添加组件了...");
        return new HelloService();
    }
}
